package com.ww.springstudy.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.DependsOn;
import org.springframework.stereotype.Component;

/**
 * 描述：
 *
 * @author 🧑 ‍wanwei
 * @since 2022-06-30 16:43
 */
@Component
public class ConfigDemo {


    /**
     * @return
     * @DependOn 标注的bean会后执行 引用的bean如果不存在 会报错!
     */
    @Bean
    @DependsOn("test1")
    public String test() {
        System.out.println("test");
        return "test";
    }

    @Bean
    public String test1() {
        System.out.println("test1");
        return "test1";
    }
}
